package com.cjh.lms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cjh.lms.mapper.TOpenLogMapper;
import com.cjh.lms.mapper.TRepairLogMapper;
import com.cjh.lms.pojo.TLockInfoExample;
import com.cjh.lms.pojo.TOpenLog;
import com.cjh.lms.pojo.TOpenLogExample;
import com.cjh.lms.pojo.TRepairLog;

//信息回传处理层
@Service("backInfoService")
public class BackInfoService {
	
	@Autowired
	TOpenLogMapper tOpenLogMapper;
	@Autowired
	TRepairLogMapper tRepairLogMapper;
	
	//开锁信息回传
	@Transactional
	public void unLockInfo(List<TOpenLog> tOpenLog){
		for(int i = 0;i < tOpenLog.size();i++){
			int check = tOpenLogMapper.insertSelective(tOpenLog.get(i));
			if(check != 1){
				int a = 1 / 0;
			}
		}
	}
	
	//维修记录回传
	public void repairLogInfo(List<TRepairLog> tRepairLog){
		for(int i = 0;i < tRepairLog.size();i++){
			int check = tRepairLogMapper.insertSelective(tRepairLog.get(i));
			if(check != 1){
				int a = 1 / 0;
			}
		}
	}
}
